|
A signature program is a small, highly condensed piece of code (commonly written in C or C++), usually three or fewer lines in length which when compiled produces an interesting pattern or function that is not always obvious from the code. Signature programs are generally found in the signature section of user posts in forums, messages etc., particularly in technically oriented websites such as Slashdot. == Optimisation and example == In order for the program, often of great complexity, which would usually be represented with many lines of code, to fit into a single line, many compression techniques are used. The following program prints out an ASCII art version of the Sierpinski triangle fractal, shown in the illustration:
An uncompressed "spelt out" version of this program may look like this: Here we can see that many portions of code are missing from the signature program, most obviously the lack of #include , no return type of main() as well as the use of non-standard main(c,r) . The ?: operator plays a vital role in reducing the overall size of the program, allowing a single expression to replace the sizeable number of if /else logical conditionals. Size is also dramatically reduced by removing all whitespace and line breaks.Signature programs often make use of undocumented or lesser-known features or quirks in a particular compiler which allow for smaller overall program size, as well as obscurity. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Signature program」の詳細全文を読む スポンサード リンク
|